#ifndef __MCS__EXCEPTION__HPP
#define __MCS__EXCEPTION__HPP

#include "String.hpp"

class Exception
{
public:
	Exception() {}
	virtual ~Exception() {}

	String what() const
	{
		std::stringstream str;
		stream(str);
		return str.str();
	}

	virtual std::ostream & stream(std::ostream & str) const = 0;
};

inline std::ostream & operator << (std::ostream & str, Exception const & ex)
{
	return ex.stream(str);
}

#endif //__MCS__EXCEPTION__HPP
